package ingress

import (
	"gitee/yinlai/kms-backend/controllers/ingress"
	"github.com/gin-gonic/gin"
)

// 实现添加集群
func create(ingressGroup *gin.RouterGroup) {
	ingressGroup.POST("/create", ingress.Create)
}

// 更新集群
func update(ingressGroup *gin.RouterGroup) {
	ingressGroup.POST("/update", ingress.Update)
}

// 删除
func delete(ingressGroup *gin.RouterGroup) {
	ingressGroup.POST("/delete", ingress.Delete)
}

// 删除列表
func deleteList(ingressGroup *gin.RouterGroup) {
	ingressGroup.POST("/deleteList", ingress.DeleteList)
}

// 获取
func get(ingressGroup *gin.RouterGroup) {
	ingressGroup.GET("/get", ingress.Get)
}

// 获取集群列表
func list(ingressGroup *gin.RouterGroup) {
	ingressGroup.GET("/list", ingress.List)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	ingressGroup := g.Group("/ingress")
	create(ingressGroup)
	update(ingressGroup)
	delete(ingressGroup)
	get(ingressGroup)
	list(ingressGroup)
	deleteList(ingressGroup)
}
